<?php
class Shop_Form_ProductWizard_Category extends Zend_Form {
	public function init() {
		$this->setMethod('post');
		$this->setAttrib('enctype', Zend_Form::ENCTYPE_MULTIPART);
		
		$this->addSubForm($this->_getDescriptionForm(),'description');
		$this->addSubForm($this->_getNavForm(),'nav');
		
		
		
		//$this->addSubForm($this->_getDescriptionForm(),'description');
	}
	
	/**
     * @return Zend_Dojo_Form_SubForm
     */
    protected function _getNavForm() {
    	$subForm = new Zend_Form_SubForm();
    	$subForm->addElement('Button','action_next', array(
    			'ignore' => true,
    			'type' => 'submit',
    			'value' => 'next',
    			'label'=>'Dodaj',
    			'class' => 'ui-state-default ui-corner-all'
    	));
    	$subForm->addElement('Button','action_back', array(
    			'ignore' => true,
    			'type' => 'submit',
    			'value' => 'back',
    			'label'=>'Cofnij',
    			'class' => 'ui-state-default ui-corner-all'
    	));
    	return $subForm;
    }

	/**
     * @return Zend_Dojo_Form_SubForm
     */
    protected function _getDescriptionForm() {
    	$subForm = new Zend_Form_SubForm();
        $subForm->setAttribs(array(
            'name'   => 'descriptiontab',
            'legend' => 'Opis',
        ));

        $summary = new Zend_Form_Element_Textarea('summary', array(
			'label'        => 'Streszczenie opisu prodiktu',
        	'description' => 'Krótki opis o produkcie',
			'inheritWidth' => 'true',
            //'required' 	   => true
		));
		$summary->addDecorator(new KontorX_Form_Decorator_TinyMCE());
		$subForm->addElement($summary);

		/*$description = new Zend_Form_Element_Textarea('description', array(
			'label'        => 'Opis produktu',
			'inheritWidth' => 'true',
            //'required' 	   => false
		));
		$description->addDecorator(new KontorX_Form_Decorator_TinyMCE());
		$subForm->addElement($description);*/

        return $subForm;
    }

}